const counters = document.querySelectorAll('.counter')

counters.forEach(count => {
    count.innerText = '0'
    const updateCount = () =>{
        const target = count.getAttribute('data-target') * 1
        const c = count.innerText * 1
        const increse = target / 200

        if(c < target){
            count.innerText = `${Math.ceil(c + increse)}`
            setTimeout(updateCount, 1)
        }else{
            count.innerText = target
        }
    }
    updateCount()
})